package com.atguigu.lease.common.utils;

import java.util.Random;

/**
 * @author Tsuchi
 * @description TODO
 * @date 2024/12/25 17:25
 */
// 随机验证码工具类
public class CodeUtil {
	// 生成随机验证码
	public static String generateCode(int length){
		StringBuilder stringBuilder = new StringBuilder();
		for (int i = 0; i < length; i++) {
			int code = new Random().nextInt(10);
			stringBuilder.append(code);
		}
		return stringBuilder.toString();
	}
}
